﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataAccess.ObjectOne
{
   public class D_Branches
    {
        SqlConnection con;
        DataTable tb = new DataTable();
        ConnectionToDataBase ex = new ConnectionToDataBase();
        public DataTable LoadDropbox()
        {
            tb = ex.executeSelectQueryNonParameter("ViewCITY_ID_CITY_NAME");
            return tb;
        }
        public DataTable LoadDropbox1()
        {
            tb = ex.executeSelectQueryNonParameter("ViewAllBranch");
            return tb;
        }
        public DataTable LoadDropbox2()
        {
            tb = ex.executeSelectQueryNonParameter("ViewAllCompany");
            return tb;
        }
        public DataTable LoadContent(int val)
        {
            SqlParameter[] sqlParameters = new SqlParameter[1];
            sqlParameters[0] = new SqlParameter("@v_CCode", SqlDbType.Int);
            sqlParameters[0].Value = val;
            tb = ex.executeSelectQuery("SearchCITY_ID", sqlParameters);
            return tb;
        }
        public DataTable LoadDetail(int val)
        {
            SqlParameter[] sqlParameters = new SqlParameter[1];
            sqlParameters[0] = new SqlParameter("@v_CCode", SqlDbType.Int);
            sqlParameters[0].Value = val;
            tb = ex.executeSelectQuery("SearchBranchID", sqlParameters);
            return tb;
        }
    }
}
